{namespace dkpoints.tests.templates}

/**
 * Set up a test blip.
 * @param testName The name of the test
 * @param testDesc Short description of the test
 * @param panelID ID to use for the console div.
 */
{template .testCase}
<div class="testCase">
  <div class="testHeader" id="{$panelID}Header">{$testName}</div>
  <div class="testDesc">{$testDesc}</div>
  <div class="testPanel" id="{$panelID}"></div>
</div>
{/template}
 
/**
 * Spits out a div to describe a test setup step.
 * @param setupDesc What are you setting up?
 */
{template .setupStep}
<div class="setupStep"><b>Setting up test condition:</b> {$setupDesc}</div>
{/template}

/**
 * Profiling results
 * @param profileResults
 */
{template .profileResults}
<div class="profileResults"><b>Profiling Results:</b> {$profileResults}</div>
{/template}

/**
 * Positive result (not necessarily test-pass)
 * @param resultString The result to print
 */
{template .positiveResult}
<div class="positiveResult"><b>Test condition passed:</b> {$resultString}</div>
{/template}

/**
 * Negative result (not necessarily test-failure)
 * @param resultString The result to print
 */
{template .negativeResult}
<div class="negativeResult"><b>Test condition failed:</b> {$resultString}</div>
{/template}

/**
 * Enumerate a list of details about a test condition success/failure
 * @param posOrNeg "positive" or "negative" prefix to the css class "[positive|negative]Result"
 * @param details Details is an array of {resultTitle: "...", resultDetail: "..."}
 */
{template .resultDetails}
<ul class="resultDetails">
{foreach $detail in $details}
 <li class="resultDetail {$posOrNeg}Result"><b>{$detail.resultTitle}:</b> {$detail.resultDetail}</li>
{/foreach}
</ul>
{/template}

/**
 * Create a span to mark a test as having passed or failed
 * @param result Did the test pass?
 */
{template .markComplete}
{sp}- <span class="{$result}">{if $result == 'pass'}Pass{else}Fail{/if}</span>
{/template}
 